﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ahelp.aspx.cs" Inherits="pufflesweb.admin.Ahelp" %>
<%@ import Namespace="PBLL" %>
<%@ import Namespace="PDAL" %>
<%@ import Namespace="PModel" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body >
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" placeholder="请输入工号" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="搜索" />
            <a href="Ahelpadd.aspx" target="Apuffles">添加新救助狗信息</a>

            <br />
            <br />
            <table  width="1200" align="center" border="1">
                <tr><td>救助ID</td><td>名字</td><td>性别</td><td>年龄</td><td>健康状态</td><td>疫苗情况</td><td>详情</td><td>图片</td><td>救助时间</td><td>操作</td></tr>

                <%
                    string id = Request.QueryString["HID"];
                    if (id != null)
                    {
                        PBLL.Help.del(int.Parse(id));
                        PF.JsHelper.AlertAndRedirect("删除成功", "Ahelp.aspx");
                    }

                    List<PModel.Help> list = PBLL.Help.list();
                    %>
                <% for (int i = 0; i < list.Count; i++)
                    {
                        string sex = "";
                        if(list[i].Hsex == 0)
                        {
                            sex = "男";
                        }
                        else if(list[i].Hsex == 1)
                        {
                            sex = "女";
                        }

                        string state = "";
                        if(list[i].Hstate == 0)
                        {
                            state = "救助中";
                        }
                        else if(list[i].Hstate == 1)
                        {
                            state = "可领养";
                        }
                        else if(list[i].Hstate == 2)
                        {
                            state = "以领养";
                        }
                        else if(list[i].Hstate == 3)
                        {
                            state = "安乐死";
                        }

                        string vaccine = "";
                        if(list[i].Hvaccine == 0)
                        {
                            vaccine = "未注射";
                        }
                        else if(list[i].Hvaccine == 1)
                        {
                            vaccine = "一针";
                        }
                        else if(list[i].Hvaccine == 2)
                        {
                            vaccine = "两针";
                        }
                        else if(list[i].Hvaccine == 3)
                        {
                            vaccine = "三针";
                        }
                        else if(list[i].Hvaccine == 4)
                        {
                            vaccine = "三针+狂犬疫苗";
                        }

                        %>

                <tr><td><%=list[i].HID%></td>
                    <td><% =list[i].Hname%></td>
                    <td><%=sex%></td>
                    <td><% =list[i].Hage%></td>
                    <td><%=state%></td>
                    <td><%=vaccine%></td>
                    <td><%=list[i].Htext%></td>
                    <td><img src="../images/helpimg/<%=list[i].Himage%>" width="80px" /></td>
                    <td><%=list[i].Htime%></td>
                    <td><a href="Ahelp.aspx?HID=<%=list[i].HID%>">删除</a> | <a href="Ahelpupdate.aspx?HID=<%=list[i].HID%>">修改</a></td></tr>
                <%} %>

            </table>
        </div>
    </form>
</body>
</html>
